//
//  HistoryDetailVM.m
//  MyDemo
//
//  Created by jay on 2020/8/23.
//  Copyright © 2020 jay. All rights reserved.
//

#import "HistoryDetailVM.h"

@implementation HistoryDetailVM

- (NSInteger)rowNumber {
    unsigned int count = 0;
    class_copyPropertyList([GithubModel class], &count);
    return count;
}

- (NSString *)propertyNameForRow:(NSInteger)row {
    unsigned int count = 0;
    objc_property_t *properties = class_copyPropertyList([GithubModel class], &count);
    const char *name = property_getName(properties[row]);
    NSString *propertyName = [NSString stringWithUTF8String:name];
    return propertyName;
}

- (NSString *)propertyValueForRow:(NSInteger)row {
    unsigned int count = 0;
    objc_property_t *properties = class_copyPropertyList([GithubModel class], &count);
    const char *name = property_getName(properties[row]);
    NSString *propertyName = [NSString stringWithUTF8String:name];
    id propertyValue = [self.curModel valueForKey:propertyName];
    if (propertyValue) {
        return propertyValue;
    } else {
        return @"";
    }
}

@end
